package com.project.bookstore.common;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

//状态码
@ApiModel("响应状态码")
public enum State {
    @ApiModelProperty("成功")
    OK(20000),

    //客户端错误
    @ApiModelProperty("请求数据错误")
    BAD_REQUEST(40000),
    @ApiModelProperty("没有权限")
    UNAUTHORIZED(40100),
    @ApiModelProperty("成功")
    ERROR_PASSWORD(40200),
    @ApiModelProperty("被阻止")
    FORBIDDEN(40300),
    @ApiModelProperty("未找到")
    NOT_FOUND(40400),
    @ApiModelProperty("不接受")
    NOT_ACCEPTABLE(40600),
    @ApiModelProperty("冲突")
    CONFLICT(40900),

    //服务端错误
    @ApiModelProperty("服务器错误")
    INTERNAL_EXCEPTION(50000),
    @ApiModelProperty("库存不足")
    NO_STOCK(50100);

    Integer state;

    State(Integer state) {
        this.state = state;
    }

    public Integer getState() {
        return state;
    }
}